This disclosure relates to generating customizable regular expressions that are usable to facilitate computer software development. More specifically, the disclosure relates to a regular expression generator that enables a user to enter granular preferences to tailor the resulting regular expression.
Many computer programming languages support use of regular expressions because regular expressions provide significant advantages in the creation and use of computer applications. For example, a computer application may require that application inputs must adhere to a specific format or pattern. This pattern can be encoded in a regular expression in order to save time, space, and effort that would otherwise be used in order to store every possible input and output matching the desired pattern. For example, a regular expression [a-zA-Z] can encode a character pattern for the alphabet (lowercase and uppercase), so that typing out the entire alphabet is not required. Additionally, regular expressions can be used to define a search pattern (e.g., where a specific pattern is being searched for, rather than a single string). For example, the regular expression [a-zA-Z], if used as a search pattern, would return all alphabetical characters (not numbers, spaces, or special characters) from a targeted text block.
Generating the desired regular expression can be subject to certain challenges. For example, as described above, a regular expression may be used to define an application input. But for this purpose, an application programmer may need to analyze and test multiple application inputs before arriving at the regular expression that patterns all the analyzed inputs. This may require testing candidate regular expressions within application code, which requires a significant amount of computing time and programmer time. Even then, this may not guarantee that the regular expression represents all possible inputs for the application. It can be tedious and time-consuming to write additional code just to test the regular expression. Additionally, where an application must adhere to more than one coding platform or programming language, the regular expression may fail to satisfy grammar requirements for each programming language.
Moreover, individuals that are unfamiliar with computer science or computer programming may be required to generate regular expressions as part of their work. These individuals may be unable to generate regular expressions without significant coaching by computer programmers, leading to further time and effort being expended. In many cases, business users may have business rules for creating patterned text (e.g., usernames that must start with a first letter of the first name plus the last name) but no ability to convert those business rules into usable application inputs using regular expressions.
Some known regular expression systems suffer from particular drawbacks. Some known systems are able to generate regular expressions for one platform or language only. These known systems provide no ability to customize or tailor the regular expression based on user preferences. Additionally, some known systems provide the ability to type a regular expression and then test it, but not the ability to enter an input string and receive a generated regular expression. Accordingly, there is a need for more effective techniques for generating regular expressions to create application inputs for a variety of computer applications.